package com.sdgakj.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name="f_role_permission")
public class RolePermission extends IdEntity{
	private Role role;
	private Permission permission;
	private String ischeck;
	private Date createdate;
		
	public RolePermission() {

	}

	public RolePermission(Role role, Permission permission) {
		this.role = role;
		this.permission = permission;
	}


	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="roleid")
	public Role getRole() {
		return role;
	}
	
	public void setRole(Role role) {
		this.role = role;
	}
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="permissionid")
	public Permission getPermission() {
		return permission;
	}
	
	public void setPermission(Permission permission) {
		this.permission = permission;
	}
	
	@Transient
	public String getIscheck() {
		return ischeck;
	}

	public void setIscheck(String ischeck) {
		this.ischeck = ischeck;
	}

	public Date getCreatedate() {
		return createdate;
	}
	
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	@Override
	public String toString() {
		return "RolePermission [role=" + role + ", permission=" + permission + ", createdate=" + createdate + "]";
	}
	
}
